<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<meta name="description" content="" />
	<meta name="keywords" content="" />
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
	<meta name="format-detection" content="telephone=no" />
	<!--嵌套css-->
	<link type="text/css" rel="stylesheet" href="/dashboard/css/bootstrap.min.css"/>
	<link type="text/css" rel="stylesheet" href="/dashboard/css/AdminLTE.min.css"/>
	<link type="text/css" rel="stylesheet" href="/dashboard/css/skins/_all-skins.min.css"/>
	<link type="text/css" rel="stylesheet" href="/dashboard/css/font-awesome.min.css"/>
	<link type="text/css" rel="stylesheet" href="/dashboard/css/temp.css"/>
	<title>照片墙后台</title>
</head>
<body class="skin-blue sidebar-mini sidebar-collapse">
	<div id="wrapper"></div>
<!--嵌套js-->
<script type="text/javascript" src="/dashboard/js/jQuery-2.1.4.min.js"></script>
<script type="text/javascript" src="/dashboard/js/underscore.min.js"></script>
<script type="text/javascript" src="/dashboard/js/backbone.min.js"></script>
<script type="text/javascript" src="/dashboard/js/react.js"></script>
<script type="text/javascript" src="/dashboard/js/react-dom.min.js"></script>
<script type="text/javascript" src="/dashboard/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/dashboard/js/jquery.slimscroll.min.js"></script>
<script type="text/javascript" src="/dashboard/js/app.min.js"></script>
<script type="text/javascript" src="/dashboard/js/wrapper.js"></script>
<script type="text/javascript" src="/dashboard/js/router.js"></script>
<!--本页js-->
<script type="text/javascript" src="/dashboard/js/wall-create.js"></script>

<script>
	ReactDOM.render(React.createElement(parllayComponents.Wrapper, {
	contentData:(function(){
		var search=location.search.slice(1);
		if(search){
			var arr=search.split('&');
			arr=_.map(arr,function(i){
				return i.split('=')
			});
			var obj=_.object(arr);
			console.log(obj);
			if(obj.id){
				return {
					name:'通缉令——老陈',
					description:'通缉：菜市场老陈。特征：手持两把大葱刀，味道很重，方圆5公里内就可闻到。请将老陈双葱带到西城居委会进行鉴定。赏金：5000元。',
					logo:'images/ju.jpg',
					qrCode:'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=gQGu8DoAAAAAAAAAASxodHRwOi8vd2VpeGluLnFxLmNvbS9xL2swTVZCb1RsRWVGb2tOMXEzRy1iAAIEyC4gVwMEAAAAAA=='
				}
			}
		}
		return null
	})(),
	getSideBar: function(sidebar){
		data=[
			{"url":"index.html","name":"照片墙列表","icon":"fa-list-ul"},
			{"url":"edit.html","name":"新建照片墙","icon":"fa-plus"}
		];
		setTimeout(function(){
			sidebar.setState({
				data:data
			})
		},0)
	}, 
	getSocialAccount: function(accounts){
		var self=this;
		$.ajax({
			type:'post',
			url:'/socialaccount',
			dataType:'json',
			success:function(data){
				if(!data.error){
					accounts.setState({
						data:data
					});
					var chosen=_.find(data,function(i){ return i.chosen>=0}) || 0;
					self.setSocialAccount(chosen)
				}
			},
			error:function(){
				var data=[
					{src: "http://brands-v2-dev.parllay.cn:3000//images/avatar1.png", name: "居委会照片墙", openID: "1qaz",chosen:true},
					{src: "http://brands-v2-dev.parllay.cn:3000//images/avatar2.png", name: "菜市场照片墙", openID: "2wsx"},
					{src: "http://brands-v2-dev.parllay.cn:3000//images/avatar3.png", name: "钱德拉天文台", openID: "3edc"}
				];
				setTimeout(function(){
					accounts.setState({
						data:data
					});
					var chosen=_.find(data,function(i){ return i.chosen>=0}) || 0;
					self.setSocialAccount(chosen)
				})
			}
		})
	},
	getUserInfo: function(user){
		var self=this;
		$.ajax({
			type:'post',
			url:'/getuser',
			dataType:'json',
			success:function(data){
				if(!data.error){
					user.setState(data)
				}
			},
			error:function(){
				var data={
					name:'白兰地中将',
					src:'http://wx.qlogo.cn/mmopen/eHJMxpAOaW3kHTfPQibZ0kxOiba6nODmGibMv5v9BjHBzR2uLWbYjNOg5ViaAxJe0hvTX13SaTUtnao2lfyhstrBpxrria4TW4aVib/0',
					date:'2016年4月11日',
					used:'0G',
					total:'10G'
				};
				setTimeout(function(){
					user.setState(data)
				},0)
			}
		})
	}}),document.getElementById('wrapper'))
</script>
</body>
</html>